<!DOCTYPE html>
<!-- 启动session -->
<?php 

require_once 'sessionInfo.class.php' ;
	
	$key = SessionInfo::getLoginInfo("ukkey");
	echo "当前登录的ukkey = " . $key . "<br>";

	// 链接数据库
	$db = "mymessageboard";
	$root = "root";
	$password = "root";
	$host = "localhost";
	$con = mysqli_connect($host, $root, $password);
	if (!$con) {
		echo "链接数据库失败";
	}

	mysqli_select_db($con, $db);
	// $sql = "select * from Persons where ukkey = '".$key."'";
	$sql = "SELECT * FROM Persons
			WHERE ukkey = '".$key."'";

	$ret = mysqli_query($con, $sql);
	if (!$ret) {
		echo "该表为空<br>";
	} else {
		while($row = mysqli_fetch_array($ret)) {
			$personname = $row["name"];
			echo "当前登录用户姓名:" . $personname . "<br>";
		}
	}
?>

<html>
<head>
	<meta charset="utf-8">
	<title>Board</title>
	<link rel="stylesheet" type="text/css" href="messageboard.css">
</head>
<body>
<div id="header">
	<h3>Board</h3>
	<h5>pls select</h5>
</div>
<div>
	<a href="login.php">登录</a>
	<a href="register.php">注册页面</a>
	<a href="test1.php">退出</a>
	<br><br>
	<a href="writesomething.php" style="">新用户用户</a>
	<a href="looksomething.php" style="">看用户</a>
	<a href="delsomething.php">更新数据</a>
	<a href="msgwrite.php">写入文章</a>
	<a href="msglook.php">看文章</a>

</div>

</body>
</html>